<?



class DataVerifier_JCATBuildin_NumberDoc extends DataVerifierDoc 
{
	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @param	$sName=''	string	What's this Parameter ?
	 * @return	array
	 */
	public function DataVerifier_JCATBuildin_NumberDoc()
	{
		$this->DataVerifierDoc() ;
		
		// 初始值
		$this->Set('NumberType',JCAT_UICtrlNumberVerifier::NUMTYPE_ALL) ;
	}
	


	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	string
	 * @static 
	 */
	static public function GetControllerName()
	{ return 'DataVerifier_JCATBuildin_Number' ; }

	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @static 
	 * @return	string
	 */
	static public function GetDVClassName()
	{
		return 'JCAT_UICtrlNumberVerifier' ;
	}
	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @return	string
	 */
	public function GetRuleIntro()
	{
		$sRuleIntro = '' ;

		switch($this->Get('NumberType'))
		{
			case JCAT_UICtrlNumberVerifier::NUMTYPE_NaN :
				return JCAT_Language::Sentence('非数字类型') ;
				break ;

			case JCAT_UICtrlNumberVerifier::NUMTYPE_INT :
				return JCAT_Language::Sentence('整数类型') ;
				break ;

			case JCAT_UICtrlNumberVerifier::NUMTYPE_FLOAT :
				return JCAT_Language::Sentence('小数类型') ;
				break ;

			case JCAT_UICtrlNumberVerifier::NUMTYPE_ALL :
				return JCAT_Language::Sentence('所有数字类型') ;
				break ;
		}
	}
	

	/**
	 * what's this
	 * 
	 * @access	public
	 * @param 	$sUICtrlVarName		string
	 * @return	string
	 */
	public function CreateCode( $sUICtrlVarName, $nTab=0 )
	{
		JCAT_ASSERT::ASSERT_STRING($sUICtrlVarName) ;
		
		if( !$this->IsEnable() )
			return '' ;
		
		$nNumberType = $this->Get('NumberType') ;
		$sTab = str_repeat('	',$nTab) ;
		
		$sRet = "{$sTab}// ".$this->GetRuleIntro()."\r\n" ;
		$sRet.= "{$sTab}{$sUICtrlVarName}->AddVerifier(JCAT_Flyweight::GetGlobalInstance('JCAT_UICtrlNumberVerifier',{$nNumberType})) ;" ;
		return $sRet ;
	}
	
	/**
	 * what's this
	 * 
	 * @access	public
	 * @static 
	 * @return	string
	 */
	static public function CreateCode_ImportClass()
	{
		return "JCAT_Package::ImportClass('JCAT_UICtrlNumberVerifier',JCAT::PACKAGE_MVCDV) ;" ;
	}
}

JCAT_Package::ImportClass('JCAT_UICtrlNumberVerifier',JCAT::PACKAGE_MVCDV) ;
?>